<template>
	<view class="pages">
		<view class="fw mlr wfc mt-20 fs-36">{{chamberObj.nickname || ''}}</view>


		<!-- 富文本 -->
		<view v-if="chamberObj.text" class="mt-50">
			<jyf-parser :html="chamberObj.text.replace(/<br\/>/ig, '')" ref="article"></jyf-parser>
		</view>
		<!-- end -->
	</view>
</template>

<script>
	import {
		comDetail,
	} from '@/api/extend.js';
	import {
		configMap
	} from "@/utils";
	import {
		mapGetters
	} from "vuex";
	import parser from "@/components/jyf-parser/jyf-parser";
	export default {
		components: {
			"jyf-parser": parser,
		},
		data() {
			return {
				chamberObj:{},
				chamber_id: '',
			}
		},
		methods: {
			getComDetailFunc() {
				comDetail({
					com_id: this.chamber_id
				}).then(res => {
					this.chamberObj = res.data
					this.$store.commit('SET_ChamberObj', res.data)
				})
			},
		},
		computed: {
			...configMap({}, mapGetters(['isLogin', 'uid', 'userInfo']))
		},
		// #ifdef MP
		onShareAppMessage: function() {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			return {
				title: this.chamberObj.nickname || '',
				path: `pages/extend/chamber/chamber_detail?uid=${this.uid || -1}&cid=${this.chamber_id}`,
			}
		},
		onShareTimeline: function() {
			return {
				title: this.chamberObj.nickname || '',
				query: {
					uid: this.uid,
					cid: this.chamber_id
				},
				imageUrl: ''
			}
		},
		// #endif
		onLoad(options) {
			this.chamber_id = options.cid;
			this.getComDetailFunc();
		},
	}
</script>

<style lang="scss" scoped>
	.pages {
		background-color: white;
		padding: 10rpx;
		width: 100%;
		min-height: 100vh;
	}
</style>